/**
 * @param {number} n
 * @return {number}
 */
var climbStairs = function (n) {

  var a = [1, 2];
  for (let i = 2; i <= n; i++) {
    a.push(a[i - 1] + a[i - 2])
  }
  return a[n - 1]
};

var climbStairs = function (n) {
  if (n == 1) {
    return 1
  }
  if (n == 2) {
    return 2
  }
  return climbStairs(n - 1) + climbStairs(n - 2)
}

var climbStairs = function (n, n1 = 1, n2 = 2) {
  if (n == 1) {
    return n1
  }
  if (n == 2) {
    return n2
  }
  return climbStairs(n - 1, n2, n1 + n2)
}